import {get} from '../../utils/request'
const state = {
    systemBills:[],
    total:0,
    data:''
}
const actions = {
    findAllSystemBill(context,list){
        get("/account/pageQuerySystemAccount",list).then(res=>{
            let response = res.data.list
            let total = res.data.total
            // console.log(res);
            context.commit('SELECT_WAITERBILL',response)
            context.commit('SELECT_TOTAL',total)
            let data= new Set()
            for(let item of response){
                data.add(item.userId)
            }
            context.commit('DATA',data)
            

        })
    },

}
const mutations ={
    SELECT_WAITERBILL(state,response){
        state.systemBills=response
    },
    SELECT_TOTAL(state,total){
        state.total = total
    },
    DATA(state,data){
        state.data=data
    }
}
export default{
    namespaced: true,
    state,
    actions,
    mutations
}